package com.liyi.letter.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liyi.letter.system.entity.Monitoring;
import com.liyi.letter.system.mapper.MonitoringMapper;
import com.liyi.letter.system.service.MonitoringService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author Administrator
* @description 针对表【monitoring】的数据库操作Service实现
* @createDate 2023-06-06 10:13:35
*/
@Service
public class MonitoringServiceImpl extends ServiceImpl<MonitoringMapper, Monitoring>
    implements MonitoringService{

    @Resource MonitoringMapper monitoringMapper;
    @Override
    public Page<Monitoring> page(Integer page, Integer pageSize, String name) {
        QueryWrapper<Monitoring> queryWrapper = new QueryWrapper<>();
        if (name != null){
            queryWrapper.like("name",name);
        }
        queryWrapper.orderByDesc("id");
        Page<Monitoring> pageInfo = new Page<>(page, pageSize);
        Page<Monitoring> monitoringPage = monitoringMapper.selectPage(pageInfo, queryWrapper);
        return monitoringPage;
    }
}




